<?php require VIEW_PATH."/header.php";?>
<body>
<link rel="stylesheet" href="Public/org/kindeditor/themes/default/default.css" />
<script src="Public/org/kindeditor/kindeditor.js"></script>
<script src="Public/org/kindeditor/lang/zh_CN.js"></script>
	<form method="post">

    <div class="hd-tab">
      <ul class="hd-tab-menu">
        <li lab="base" class="active">
          <a> 基本设置 </a>
        </li>
        <li lab="pics">
          <a>商品图集 </a>
        </li>
        <li lab="attribute">
          <a>商品属性</a>
        </li>
        <li lab="service">
          <a>商品详情</a>
        </li>
      </ul>
      <div class="hd-tab-content">
        <div lab="base" class="hd-tab-area">
          <table class="hd-table hd-table-form hd-form">
            <thead>
              <tr>
                <td colspan="2">添加商品</td>
              </tr>
            </thead>
            <tbody>
              <tr>
                <th>父级</th>
                <td>
                 <select name="cat_id">
                   {{foreach from="$catData" value="$v"}}
                   <option value="{{$v['cat_id']}}">{{$v['_name']}}</option>
                   {{endforeach}}
                 </select>
               </td>
             </tr>
             <tr>
              <th>商品名称</th>
              <td>
                <input type="text" name="goods_name" class="hd-w300">
              </td>
            </tr>
            <tr>
              <th>货号</th>
              <td>
                <input type="text" name="goods_sn" class="hd-w300">
              </td>
            </tr>
            <tr>
              <th>单位</th>
              <td>
                <input type="text" name="unit" class="hd-w300">
              </td>
            </tr>
            <tr>
              <th>品牌</th>
              <td>
               <select name="brand_id">
                 {{foreach from="$brandData" value="$v"}}
                 <option value="{{$v['id']}}">{{$v['name']}}</option>
                 {{endforeach}}
               </select>
             </td>
           </tr>
         </tr>
         <tr>
          <th>点击数</th>
          <td>
            <input type="text" name="click" class="hd-w300">
          </td>
        </tr>
        <tr>
          <th>列表页图</th>
          <td>
            <img src='Public/images/thumb.jpeg' style="width:50px"/>
            <input type="hidden" name="list_pic" class="hd-w300">
            <button type="button" id="list_pic">上传图片</button>
            <script>
              KindEditor.ready(function(K) {
                var editor = K.editor({
                  allowFileManager : false,
                  uploadJson : 'index.php?m=Admin&c=Upload&a=upload',
                });
                
                K('#list_pic').click(function(e) {
                  editor.loadPlugin('image', function() {
                    editor.plugin.imageDialog({
                      showRemote : false,
                      clickFn : function(url, title, width, height, border, align) {
                        $('[name=list_pic]').val(url);
                        $('img').attr('src','.'+url);
                        editor.hideDialog();
                      }
                    });
                  });
                });
              });
            </script>
          </td>
        </tr>
        <tr>
          <th>缩略图</th>
          <td>
            <input type="file" name="thumb_pic" class="hd-w300">
          </td>
        </tr>
        <tr>
          <th>栏目关键词</th>
          <td>
            <input type="text" name="keyword" class="hd-w300">
          </td>
        </tr>
        <tr>
          <th>栏目描述</th>
          <td>
            <textarea name="dest" class="hd-w300 hd-h100"></textarea>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <button class="hd-btn hd-btn-primary">提交</button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <!-- 图集 -->
  <div lab="pics" class="hd-tab-area">

  </div>
  <!-- end图集 -->
  <!-- 服务 -->
  <div lab="attribute" class="hd-tab-area">

  </div>
  <!-- end服务 -->
  <!-- 服务 -->
  <div lab="service" class="hd-tab-area">

  </div>
  <!-- end服务 -->
</div>
</div>
</form>

</body>
</html>











